package com.xy.springcloud.service;

import com.xy.springcloud.mapper.DeptMapper;
import com.xy.springcloud.pojo.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptMapper deptMapper;

    @Override
    public boolean addDept(Dept dept) {
        int insert = deptMapper.insert(dept);
        if (insert>0){
            return true;
        }
        return false;
    }

    @Override
    public Dept queryByid(Long id) {
        return deptMapper.selectById(id);
    }

    @Override
    public List<Dept> queryAll() {
        return deptMapper.selectList(null);
    }
}
